package com.wlyuan.open.scanner.utils.enums.quotation;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @Description 老系统订单类型，1 客户订单 2 运输订单 3 拼车订单
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum QuotationSubjectTypeEnum implements NamedValue<Long> {

    /**
     * 客户订单
     */
    CLIENT_ORDER(1L, 1, "客户订单"),
    /**
     * 运输订单
     */
    TRANSPORT_ORDER(2L, 1, "运输订单"),
    /**
     * 拼车订单
     */
    COMBINE_ORDER(3L, 2, "拼车订单");

    private final Long value;
    private final Integer newValue;
    private final String name;


    private static final Map<Long, QuotationSubjectTypeEnum> MAP = new NamedValueMap<>(QuotationSubjectTypeEnum.class);

    public static QuotationSubjectTypeEnum fromValue(Long value) {
        return MAP.get(value);
    }
}
